from mcp.server.fastmcp import FastMCP

# 创建 MCP 服务实例
mcp = FastMCP("Calculator Server")

@mcp.tool()
def add(a: float, b: float) -> float:
    """两数相加"""
    return a + b

@mcp.tool()
def subtract(a: float, b: float) -> float:
    """两数相减"""
    return a - b

@mcp.tool()
def multiply(a: float, b: float) -> float:
    """两数相乘"""
    return a * b

@mcp.tool()
def divide(a: float, b: float) -> float:
    """两数相除"""
    return a / b

if __name__ == "__main__":
    mcp.run()